<script setup lang="ts">
import Comment from "@/components/comment/index.vue"
import {onBeforeMount, ref} from "vue";
import {recorderBehavior} from "@/api/system/system";
import {commonConsoleLog, ECode} from "@/util/commonUtil";

const commentInfo = ref<any>({
  maxReplyLevel: 5, // 最大回复深度
  source: "MESSAGE_BOARD"
})

onBeforeMount(() => {
  // 3S后埋点信息上报
  setTimeout(() => {
    recorderBehavior({'otherData': '留言', 'behavior': 'VISIT_PAGE'}).then((response: any) => {
      if (response.code == ECode.SUCCESS) {
        commonConsoleLog('留言页信息上报成功')
      }
    })
  }, 3000)
})

</script>

<template>
  <section class="messageBoard max-w-screen-lg m-auto mt-8 w-full rounded-xl mb-12">
    <Comment :tableName="commentInfo.source" :maxReplyLevel="commentInfo.maxReplyLevel" :showCancel="false"/>
  </section>
</template>

<style scoped lang="less">

</style>
